// pages/my/my.js
import Config from "../../common/config.js";
Page({

  /**
   * 页面的初始数据
   */
  data: {
    memList: {},
    maList:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var sessionId = wx.getStorageSync('sessionId')
    var that = this
    wx.request({
      url: Config.url + '/api/integralLevel/member_centre_upgrade',
      method: 'POST',
      header: {
        'content-type': 'application/json',
        'cookie': sessionId
      },
      success(res) {
        console.log(res)
        that.setData({
          memList: res.data.data.responseMap,

        })
        console.log(that.data.memList)
      }
    })


    wx.request({
      url: Config.url + '/api/user/info',
      method: 'POST',
      header: {
        'content-type': 'application/json',
        'cookie': sessionId
      },
      data:{},
      success(res) {
        console.log(res)
        that.setData({
          maList: res.data.data.data,

        })
        console.log(that.data.maList)
      }
    })
  },


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
    goCenter: function () {
        wx.navigateTo({
            url: '../memberCenter/memberCenter'
        })
  },
    goOrder: function () {
        wx.navigateTo({
            url: '../order/order'
        })
  },
    goWallet: function () {
        wx.navigateTo({
            url: '../wallet/wallet'
        })
  },
    goAdress: function () {
        wx.navigateTo({
            url: '../adressList/adressList'
        })
  },
    goCoupon: function () {
        wx.navigateTo({
            url: '../couponCard/couponCard'
        })
  },
    goMessage: function () {
        wx.navigateTo({
            url: '../message/message'
        })
    },
  goSet: function () {
    wx.navigateTo({
      url: '../setting/setting'
    })
  },
    // 跳转到分享
    toFenxiang:function(e){
        wx.navigateTo({
            url: '../fenxiang/fenxiang',
        })
    },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})